<?php /*a:3:{s:50:"D:\phpstudy_pro\WWW\night\app\view\brands\add.html";i:1601039200;s:53:"D:\phpstudy_pro\WWW\night\app\view\public\header.html";i:1601967767;s:53:"D:\phpstudy_pro\WWW\night\app\view\public\footer.html";i:1601179064;}*/ ?>
<header>
    <title>品牌<?php if(!(empty($list) || (($list instanceof \think\Collection || $list instanceof \think\Paginator ) && $list->isEmpty()))): ?>修改<?php else: ?>添加<?php endif; ?></title>
</header>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <script src="/static/layui/layui.js"></script>
    <script src="/static/jquery.min.js"></script>
</head>
<body class="layui-layout-body">

<div class="layui-layout layui-layout-admin">

    <div class="layui-header">
        <div class="layui-logo">商品后台管理系统</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="/index/welcome">首页</a></li>
            <li class="layui-nav-item"><a href="/node/add">节点添加</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">其它系统</a>
                <dl class="layui-nav-child">
                    <dd><a href="">邮件管理</a></dd>
                    <dd><a href="">消息管理</a></dd>
                    <dd><a href="">授权管理</a></dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                    <?php echo htmlentities($user['admin_name']); ?>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="/admin/LoginOut">退了</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <?php foreach($node_list as $key=>$vo): ?>
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;"><?php echo htmlentities($vo['node_name']); ?></a>
                    <dl class="layui-nav-child">

                        <?php foreach($vo['node'] as $k=>$v): ?>
                        <dd><a href="<?php echo htmlentities($v['node_url']); ?>"><?php echo htmlentities($v['node_name']); ?></a></dd>
                        <?php endforeach; ?>
                    </dl>
                </li>
                <?php endforeach; ?>
<!--                <li class="layui-nav-item">-->
<!--                    <a href="javascript:;">解决方案</a>-->
<!--                    <dl class="layui-nav-child">-->
<!--                        <dd><a href="javascript:;">列表一</a></dd>-->
<!--                        <dd><a href="javascript:;">列表二</a></dd>-->
<!--                        <dd><a href="">超链接</a></dd>-->
<!--                    </dl>-->
<!--                </li>-->
<!--                <li class="layui-nav-item"><a href="">云市场</a></li>-->
<!--                <li class="layui-nav-item"><a href="">发布商品</a></li>-->
            </ul>
        </div>
    </div>

    <div class="layui-body">
<br>
<form class="layui-form" action="" method="post">
    <?php if(!(empty($list) || (($list instanceof \think\Collection || $list instanceof \think\Paginator ) && $list->isEmpty()))): ?><input type="hidden" name="id" value="<?php echo htmlentities($list['id']); ?>"><?php endif; ?>

    <div class="layui-form-item">
        <label class="layui-form-label">品牌名称</label>
        <div class="layui-input-block">
            <input style="width: 240px" type="text" value="<?php if(!(empty($list) || (($list instanceof \think\Collection || $list instanceof \think\Paginator ) && $list->isEmpty()))): ?><?php echo htmlentities($list['brand_name']); ?><?php endif; ?>" name="brand_name" required  lay-verify="required" placeholder="请输入品牌名称" autocomplete="off" class="layui-input">
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input style="width: 240px"  value="<?php if(!(empty($list) || (($list instanceof \think\Collection || $list instanceof \think\Paginator ) && $list->isEmpty()))): ?><?php echo htmlentities($list['sort']); ?><?php endif; ?>"  type="text" name="sort" required  lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="0" title="启用" <?php if(!(empty($list) || (($list instanceof \think\Collection || $list instanceof \think\Paginator ) && $list->isEmpty()))): if($list['status']==0): ?>checked<?php endif; else: ?>checked<?php endif; ?>>
            <input type="radio" name="status" value="1" title="未启用" <?php if(!(empty($list) || (($list instanceof \think\Collection || $list instanceof \think\Paginator ) && $list->isEmpty()))): if($list['status']==1): ?>checked<?php endif; ?><?php endif; ?>>
        </div>
    </div>

    <div class="layui-upload" style="margin-left: 100px">
        <button type="button" class="layui-btn" id="test1"><?php if(!(empty($list) || (($list instanceof \think\Collection || $list instanceof \think\Paginator ) && $list->isEmpty()))): ?>修改<?php else: ?>上传<?php endif; ?>LOGO</button>
        <div class="layui-upload-list">
            <img class="layui-upload-img" <?php if(!(empty($list) || (($list instanceof \think\Collection || $list instanceof \think\Paginator ) && $list->isEmpty()))): ?>src="<?php echo htmlentities($list['logo']); ?>"<?php endif; ?> hight="200" width="200" id="demo1">
            <p id="demoText"></p>
        </div>
    </div>

    <input type="hidden" id="img" name="logo" value="">

    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">品牌描述</label>
        <div class="layui-input-block">
            <textarea name="describe"  placeholder="请输入描述" class="layui-textarea"><?php if(!(empty($list) || (($list instanceof \think\Collection || $list instanceof \think\Paginator ) && $list->isEmpty()))): ?><?php echo htmlentities($list['describe']); ?><?php endif; ?></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>


<script>


    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            // layer.msg(JSON.stringify(data.field));
            // return false;
        });
    });
</script>

<script>
    layui.use('upload', function(){
        var $ = layui.jquery
            ,upload = layui.upload;

        //普通图片上传
        var uploadInst = upload.render({
            elem: '#test1'
            ,url: '/brands/update' //改成您自己的上传接口
            ,method: 'post'
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function(index, file, result){
                    $('#demo1').attr('src', result); //图片链接（base64）
                });
            }
            ,done: function(res){
                //如果上传失败
                if(res.code > 0){
                    return layer.msg('上传失败');
                }else if(res.code == 0){
                    $("#img").val(res.msg);
                }
                //上传成功
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });

    });
</script>



</div>
</div>

<!--<div class="layui-footer">-->
<!--    &lt;!&ndash; 底部固定区域 &ndash;&gt;-->
<!--    © layui.com - 底部固定区域-->
<!--</div>-->
</div>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;

    });
</script>
</body>
</html>